<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui"
      >

    <ui:composition template="./WEB-INF/includes-templates/template.xhtml">
        <ui:param name="pageTitle" value="#{trans.system_name}" />
        <ui:define name="content" >
            <ui:include src="/WEB-INF/includes/searchBar.xhtml" />
            <h3>#{trans.b_schoolMat}</h3>
            <br />
            <h5><h:link outcome="schoolMat">#{trans.year}</h:link> | #{year.year}</h5>

            <h:form id="subjectForm" > 
                <p:dataTable var="sm"  value="#{schoolmat.selectedSchoolMat}">  
                    <f:facet name="header">  
                        #{trans.subject}  
                    </f:facet>  

                    <p:column id="modelHeader" sortBy="#{sm.subject.name}">  
                        <f:facet name="header">  
                            <h:outputText value="#{trans.name}" />  
                        </f:facet>  
                        <h:outputText value="#{sm.subject.name}" />  
                    </p:column> 

                    <p:column sortBy="#{sm.subject.shortcut}">  
                        <f:facet name="header">  
                            <h:outputText value="#{trans.shortcut}" />  
                        </f:facet>  
                        <h:outputText value="#{sm.subject.shortcut}" />  
                    </p:column> 

                    <p:column sortBy="#{sm.subject.department}">  
                        <f:facet name="header">  
                            <h:outputText value="#{trans.department}" />  
                        </f:facet>  
                        <h:outputText value="#{sm.subject.department}" />  
                    </p:column> 

                    <p:column style="width:4%">  
                        <p:commandButton id="selectButton" icon="ui-icon-search" title="View" ajax="false" 
                                         action="#{schoolmat.pickSubject(sm)}">  
                            <f:setPropertyActionListener target="#{schoolmat.selectedSchoolMat}" value="#{schoolmat.schoolMatsBySubject(sm)}" />
                        </p:commandButton>  
                    </p:column> 


                </p:dataTable>  
            </h:form>      

        </ui:define>
    </ui:composition>

</html>